import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}
export function tabList(query) {
  return request({
    url: 'https://agi-test.geekpark.net/api/test/list',
    method: 'get',
    params: query
  })
}
export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: 'https://agi-test.geekpark.net/article/create',
    method: 'post',
    data
  })
}

export function ModifyStatus(data) {
  return request({
    url: 'https://agi-test.geekpark.net/article/status',
    method: 'post',
    data
  })
}

export function DeleteList(data) {
  return request({
    url: 'https://agi-test.geekpark.net/article/delete',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}

export function uploadTest(data) {
  return request({
    url: 'http://localhost:3000/article/test',
    method: 'post',
    data
  })
}

// export function FeishuToken(data) {
//   return request({
//     url: 'http://localhost:3000/article/feishu/access_token',
//     // url: 'https://open.feishu.cn/open-apis/authen/v1/access_token',
//     method: 'post',
//     data
//   })
// }

export function Dictionary(data) {
  return request({
    url: 'https://agi-test.geekpark.net/article/dictionary',
    // url: 'https://open.feishu.cn/open-apis/authen/v1/access_token',
    method: 'post',
    data
  })
}



export function Comments(data) {
  return request({
    url: 'https://agi-test.geekpark.net/article/comments',
    // url: 'https://open.feishu.cn/open-apis/authen/v1/access_token',
    method: 'post',
    data
  })
}




export function Replies(data) {
  return request({
    url: 'https://agi-test.geekpark.net/article/replies',
    // url: 'https://open.feishu.cn/open-apis/authen/v1/access_token',
    method: 'post',
    data
  })
}




export function FeishuList(data) {
  return request({
    url: 'https://agi-test.geekpark.net/article/feishu/pinglun',
    // url: 'https://open.feishu.cn/open-apis/authen/v1/access_token',
    method: 'post',
    data
  })
}

